// teleport.txt
// Pylons for the teleporter system
// Cell 0 - Which pylon this is.

beginobjectscript; // talking object

variables;

body;

beginstate INIT_STATE;
	if (get_flag(191,get_memory_cell(0)) > 0)
		set_object_icon(ME,4);
	break;

beginstate DEAD_STATE;
	break;

beginstate START_STATE; 
	break;

beginstate USE_STATE;
	if (get_flag(191,get_memory_cell(0)) == 0) {
		sf(191,get_memory_cell(0),1);
		set_object_icon(ME,4);
		
		if ((which_town() == 20) && (get_flag(190,2) == 0))
			ok_dlog(47,2);
			else {
				print_str_color("You inspect the pylon. There is a phrase carved into the base:",2);
				if (which_town() == 20)
					print_str_color("  Vel Ner Sem",2);
				if (which_town() == 1)
					print_str_color("  Amb Lel Kya",2);
				if (which_town() == 4)
					print_str_color("  Zed Pel Nog",2);
				if (which_town() == 6)
					print_str_color("  Hoo Zim Bes",2);
				if (which_town() == 8)
					print_str_color("  Ain Eff Wyx",2);
				if (which_town() == 10)
					print_str_color("  Vai Tor Kva",2);
				if (which_town() == 11)
					print_str_color("  Eft Eal Dra",2);
				if (which_town() == 46)
					print_str_color("  Pie Noo Ley",2);
				print_str_color("You take note of it.",2);
			
				}
		run_sparkles_on_object(ME,4,12,1);
		play_sound(157);
		}
		else if ((get_flag(190,2) == 0) && (get_flag(191,get_memory_cell(0)) > 0)) {
			print_str_color("The pylon still makes your skin tingle, but you don't know",2);
			print_str_color("  what to do with it. Perhaps someone will teach you someday.",2);			
			}
			else {
				// teleport
				telep_to_ft_aver();
				}
break;


beginstate RUN_ANIM_STATE;
	if (get_flag(191,get_memory_cell(0)) > 0) {
		if (get_ran(1,0,100) < 25) 
			run_sparkles_on_object(ME,5,4,1);
		}
		
		
	break;